package de.tydejay.lazysms.shared;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class KontaktDTO implements Serializable{

	private static final long serialVersionUID = -213730448095079793L;
	
	@Persistent
	@PrimaryKey
	private Long id;
	@Persistent
	private String nachname;
	@Persistent
	private 	String vorname;
	@Persistent
	private ArrayList<NummerDTO> nummern;
	
	public String getNachname() {
		return nachname;
	}
	public void setNachname(String nachname) {
		this.nachname = nachname;
	}
	public String getVorname() {
		return vorname;
	}
	public void setVorname(String vorname) {
		this.vorname = vorname;
	}
	public List<NummerDTO> getNummern() {
		return nummern;
	}
	public void setNummern(ArrayList<NummerDTO> nummern) {
		if (!(nummern instanceof ArrayList)) {
			ArrayList<NummerDTO> list = new ArrayList<NummerDTO>(nummern.size());

			for (NummerDTO nummer : nummern) {
				list.add(nummer);
			}

			this.nummern = list;

		} else {
			this.nummern = nummern;
		}
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	
	
}
